package com.candy.myannotation;

import java.lang.reflect.Method;

/**
 * @author donglin
 * @Title:
 * @类名: Test
 * @date 2020/6/5
 */
public class Test {
    public static void main(String[] args) {
        Class type=Student.class;
        try {
            Method m=type.getDeclaredMethod("sayHi");
           MyAnnotation myAnnotation= m.getDeclaredAnnotation(MyAnnotation.class);
           String name=myAnnotation.name();
           String[] course=myAnnotation.course();
            for (String msg:course
                 ) {
                System.out.println(msg);
            }
            System.out.println(name);

        } catch (Exception e) {
            e.printStackTrace();
        }


    }
}
